<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="header.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DtdHTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Add Software</title>
<script>
	$(document).ready(function(){
	    $("table tbody tr:even").addClass("tdbgcolor1"); 
	    $("table tbody tr:odd").addClass("tdbgcolor2"); 
	});
	function checkAndSubmit(){
		var form = document.getElementById("editSoftwareForm");
		form.submit();
	}
	function showUploadWindow(id){
		var InfoW=620;
		var InfoH=400;
		var InfoUrl="edit/insert_images.action?uploadFolder=<%=com.windfone.common.Constant.UPLOAD_SOFTWARE %>";
		var str=window.showModalDialog(InfoUrl,"","dialogWidth="+InfoW+"px;dialogHeight="+InfoH+"px;center=yes;help=no;resizable=no;status=no;scroll=no");
		if ( str != undefined){
			$("#"+id).val(str);
			$("#"+id+"1").attr("src","<%=contextPath%>/"+str);
		}		
	}	
	function showUploadFileWindow(){
		var InfoW=620;
		var InfoH=400;
		var InfoUrl="edit/uploadFilePage.action?uploadFolder=<%=com.windfone.common.Constant.UPLOAD_SOFTWARE %>";
		var str=window.showModalDialog(InfoUrl,"","dialogWidth="+InfoW+"px;dialogHeight="+InfoH+"px;center=yes;help=no;resizable=no;status=no;scroll=no");
		if ( str != undefined){
			$("#fileName").val(str);
			$("#fileName1").attr("value","<%=contextPath%>/"+str);
		}		
	}	
</script>
</head>
<body>
<div align="center">编辑软件</div>
<form method="post" action="updateSoftware.action" id="editSoftwareForm">
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
	<tr>
		<td width="50">软件类型:</td>
		<td>
			<s:select list="softwareTypes"  listValue="name" listKey="id"  name="softwareTypeId"  id="softwareTypeId"></s:select>
	  </td>
	</tr>
	<tr>
		<td>名称:</td>
	  <td><input name="name" type="text" id="name" size="50" maxlength="50"  value="<s:property value='bean.name'/>" /></td>
	</tr>
	<tr>
		<td>路径名称:</td>
	  <td>
	  	<input name="fileName1"  type="text"  id="fileName1" value="<s:property value='bean.fileName'/>"  size="50"  maxlength="50"/>
	  	<input type="button" value="上传软件"   onClick="showUploadFileWindow()"/></td>
	</tr>
	<tr>
		<td>最高版本:</td>
	  <td><input name="version" type="text" id="version"    size="50" maxlength="10"  value="<s:property value='bean.version'/>" /></td>
	</tr>
	<tr>
		<td>适应平台:</td>
		<td><input name="system" type="text" id="system" size="50" maxlength="25" value="<s:property value='bean.system'/>" /></td>
	</tr>
	<tr>
		<td>最后更新:</td>
		<td><input name="lastUpdate" type="text" id="lastUpdate" size="50" maxlength="50" value="<s:property value='bean.lastUpdate'/>" /></td>
	</tr>
	<tr>
		<td>关键字:</td>
		<td><input name="keyword" type="text" id="keyword" size="50" maxlength="50" value="<s:property value='bean.keyword'/>" /></td>
	</tr>
	<tr>
		<td>功能描述:</td>
		<td><textarea name="content" id="content" rows="10" cols="50"><s:property value='bean.content'/></textarea></td>
	</tr>
	
	<tr>
		<td>语言:</td>
		<td><select name="langId" id="langId">
			<option value="0" <s:if test='bean.langId==0'>selected</s:if> >简体</option>
			<option value="1" <s:if test='bean.langId==1'>selected</s:if> >繁体</option>
			<option value="2" <s:if test='bean.langId==2'>selected</s:if> >英语</option>
		</select></td>
	</tr>	
	<tr>
		<td>软件小图:</td>
	  	<td>
	  	<img src="<%=contextPath%>/<s:property value='bean.smallImagepath'/>"  id="smallImagepath1" name="smallImagepath1" border="0"/>&nbsp;<input type="button" value="小图"  onClick="showUploadWindow('smallImagepath')"/>
		</td>
	</tr>	
	<tr>
		<td>软件大图:</td>
	  	<td>
	  		<img src="<%=contextPath%>/<s:property value='bean.bigImagepath'/>"  id="bigImagepath1" name="bigImagepath1" border="0"/>&nbsp;<input type="button" value="大图"  onClick="showUploadWindow('bigImagepath')"/>
		</td>
	</tr>	
	<tr>

		<td colspan="2" >
			<input type="hidden" name="smallImagepath" id="smallImagepath" value="<s:property value='bean.smallImagepath'/>"/>
			<input type="hidden" name="bigImagepath" id="bigImagepath" value="<s:property value='bean.bigImagepath'/>"/>
			<inut type="hidden" id="softwareId" name="softwareId" value="<s:property value='bean.id'/>" />
			<input type="hidden" name="fileName" id="fileName" value="<s:property value='bean.fileName'/>"/>
			<input type="button" value="Save"  onclick="checkAndSubmit()"/>&nbsp;
			<input	type="button" value="reset" />&nbsp;
			<input	type="button" value="返回"  onclick="javascript:window.history.back();" />
		</td>
</table>
</form>
</body>
</html>
